package ruler.main;

import ruler.preferences.RulerPreferencesActivity;

import ruler.rules.activities.GPSRulesListActivity;
import ruler.rules.activities.WifiRulesListActivity;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class WifiGPSRulerActivity extends TabActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		Resources res = getResources();
		TabHost tabHost = getTabHost();
		TabHost.TabSpec spec;
		Intent intent;

		intent = new Intent().setClass(this, WifiRulesListActivity.class);
		spec = tabHost
				.newTabSpec("wifi")
				.setIndicator("Wifi Rules",
						res.getDrawable(R.drawable.ic_tab_wifi))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, GPSRulesListActivity.class);
		spec = tabHost
				.newTabSpec("gps")
				.setIndicator("GPS Rules",
						res.getDrawable(R.drawable.ic_tab_gps))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, RulerPreferencesActivity.class);
		spec = tabHost
				.newTabSpec("preferences")
				.setIndicator("Settings",
						res.getDrawable(R.drawable.ic_tab_settings))
				.setContent(intent);
		tabHost.addTab(spec);

		tabHost.setCurrentTab(0);
	}

}